//
// Created by lingzhitech on 25-10-27.
//

#ifndef FOLDER_HPP
#define FOLDER_HPP
#include <set>

// #include "Message.hpp"

class Message;
class Folder {
    friend class Message;
    friend std::ostream& operator<<(std::ostream& os, const Folder& folder);
public:
    Folder() = default;
    //messages遍历调用message->save(*this)
    Folder(const Folder&);
    Folder(std::initializer_list<Message*> messages);
    //messages遍历调用message->remove(*this), copy, messages遍历调用message->save(*this)
    Folder& operator=(const Folder&);
    //遍历messages，调用message -> remove(*this)
    ~Folder();

    void addMessage(Message* message);
    void removeMessage(Message* message);
private:
    void removeFolderFromMessages();
    void addFolderToMessages();
    std::set<Message*> messages;
};



#endif //FOLDER_HPP
